package com.gang.mars.redisson.Thread;

public class Apple01Thread {

    /**
     * 参考学习：https://www.bilibili.com/video/BV1V4411p7EF?p=2&spm_id_from=pageDriver
     * Thread 对线程的抽象
     * */
    private static class GangThread extends Thread{
        @Override
        public void run(){
            //super.run();

            //TODO
            for (int i = 0; i < 100; i++) {
                System.out.println("GangThread do your biz...");
            }

        }
    }

    /**
     * Runnable 是对任务抽象
     * */
    private static class GangRunnable implements Runnable{

        @Override
        public void run() {
            System.out.println("GangRunnable do your biz");
        }
    }

    public static void main(String[] args) {

        //test1();

        test2();
    }

    public static void test1(){
        GangThread gangThread = new GangThread();
        gangThread.start();
        for (int i = 0; i < 1000; i++) {
            System.out.println(" main thread....");
        }
    }

    public static void test2(){
        GangRunnable gangRunnable = new GangRunnable();
        new Thread(gangRunnable).start();
    }


}
